Next | Prev | Up | Top | Contents | Index

Generating Outgoing Signals

A program can generate an outgoing signal on any one of the four external interrupt lines. To do so, it first opens /dev/ei. Then it can apply ioctl() on the file descriptor to switch the outgoing lines. The principal functions are summarized in Table 6-1.

Functions for Outgoing External Signals
OperationTypical ioctl() Call
Set pulse width to N microseconds.ioctl(eifd, EIIOCSETOPW, N)
Return current output pulse width.ioctl(eifd,EIIOCGETOPW,&var)
Send a pulse on some lines M.[1]ioctl(eifd, EIIOCSTROBE, M)
Set a high (active, asserted) level on lines M.ioctl(eifd, EIIOCSETHI, M)
Set a low (inactive, deasserted) level on lines M.ioctl(eifd, EIIOCSETLO, M)

In the Challenge and Onyx series, the level on an outgoing external interrupt line is set directly from a CPU. The device driver generates a pulse (function EIIOCSTROBE) by asserting the line, then spinning in a disabled loop until the specified pulse time has elapsed, and finally deasserting the line. Clearly, if the pulse width is set to much more than the default of 5 microseconds, pulse generation could interfere with the handling of other interrupts.

The calls to assert and deassert the outgoing lines (functions EIIOCSETHI and EIIOCSETLO) do not tie up the kernel. However, direct assertion of the outgoing signal should be used only when the desired signal frequency and pulse duration are measured in milliseconds or seconds. No user-level program can hope to generate pulse durations measured in microseconds by calling these functions. For one thing, the minimum guaranteed interrupt service time is 200 microseconds. An interrupt occurring between the call to assert the signal and the call to deassert it will stretch the intended pulse width by at least 200 microseconds.


[1] M is an unsigned integer whose bits 0, 1, 2, and 3 correspond to the external interrupt lines 0, 1, 2, and 3. At least one bit must be set.
Next | Prev | Up | Top | Contents | Index